package com.boang.ch;

import java.io.*;

/*
    @author:sa
    @date:2024/12/12 15:12
*/
public class FileInputOutputDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("C:\\Users\\sa\\Desktop\\新建 文本文档.txt");
        BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
        FileOutputStream fileOutputStream = new FileOutputStream("C:\\Users\\sa\\Desktop\\新建 文本文档1.txt");
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream);
        int i=0;
        long start=System.currentTimeMillis();
    while ((i=fileInputStream.read())!=-1){
        fileOutputStream.write(i);
    }
    fileOutputStream.close();
    fileInputStream.close();
        long end=System.currentTimeMillis();
        System.out.println((end-start)/1000);
    }
}